Skip to content

Conversation

@joshheald
Copy link
Contributor

@joshheald joshheald commented Dec 5, 2022

Part of: #8295

Description

In sTAP Away, we're adding support for Apple's built in card readers to take in-person payments. We continue to use Stripe's SDK to handle payments.

Stripe's connection flow is technically very similar to the bluetooth reader flow, but conceptually, there are differences and it's important that we make it clear to users that they are using the built in reader, and don't give the wrong impression that they are connecting to a bluetooth reader, to avoid confusion. Part of that is to display relevant errors and tips to resolve them.

This PR adds the specific error codes which can be produced by the Stripe SDK related to tap on mobile flows. These will show if card reader discovery fails for these reasons. They will show in a generic error screen: #8082 includes tasks to make specific screens for some of these errors.

Testing instructions

🚨 I've been unable to test all of these errors, as iOS wouldn't let me remove the passcode from my device(!)

Using an iPhone XS or newer on iOS 15.7 or older

  1. Navigate to Menu > Settings > Experimental features
  2. Turn on Tap to Pay on iPhone
  3. Navigate to Menu > Payments > Collect payment
  4. Go through the payment flow, and select Card on the payment method screen
  5. When asked for a reader type, tap Tap to Pay on iPhone and go through the Terms of Service Apple ID linking (if you've not done so before)
  6. Observe that you see an error message telling you that you need to use iOS 16 or newer

Using an iPhone XS or newer on iOS 16.0 without a passcode set

Repeat the above steps, and observe that you see an error message advising you to set a passcode

Using an iPhone XS or newer on iOS 16.0 with a passcode which is not signed in to iCloud

Repeat the above steps, and observe that you see an error message advising you that you need to sign in to iCloud.

Note that this error should only show for a merchant account which has not had Apple's terms of service accepted.

N.B. There are known issues with the payment flow after connection. In particular, #8289, #8288, #8274, and #8085. The payment flow "works", but these issues aren't addressed yet, and some are pre-existing in the legacy flow (just a lot less obvious when you use a bluetooth reader.)

Please do note any issues you find, but give me a shout if you want to check they're known first, just to save writing out detailed repro steps.

Screenshots

unsupported-device


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

The iPhone’s built in card reader may need to be configured before it can be used. In this case, Stripe will call our LocalMobileConnectionDelegate with progress of the configuration, in the same way as it does for bluetooth reader software updates.

This commit duplicates and updates the bluetooth reader software update alert for use with configuration updates.
@joshheald joshheald added type: task An internally driven task. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels Dec 5, 2022
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 5, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8315-6b00ce8 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@joshheald joshheald added the status: feature-flagged Behind a feature flag. Milestone is not strongly held. label Dec 5, 2022
@joshheald joshheald added this to the 11.6 milestone Dec 5, 2022
@joshheald joshheald marked this pull request as ready for review December 5, 2022 18:42
@joshheald joshheald requested a review from koke December 5, 2022 18:42
Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only able to test the iOS 15 case, since logging out of iCloud on my main device would be very inconvenient, but the code looks good.

@@ -0,0 +1,39 @@
import UIKit

protocol CardPresentModalProgressDisplaying: CardPresentPaymentsModalViewModel {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part doesn't seem related to errors or mentioned in the description/testing, I'm wondering if this was intentionally included

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github's being a bit strange.

Here's the first four commits from this PR:
CleanShot 2022-12-07 at 13 03 04@2x

And here's the three commits from the previous PR, which is merged to trunk:
CleanShot 2022-12-07 at 13 03 54@2x

So... they're all already in trunk with matching hashes, so I'm pretty sure this will sort itself out when I merge this PR... but I will check carefully! Thanks for the heads-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants